<template>
<el-dialog
   title="查看律师函"
  :visible.sync="dialogVisible">
  <div id="pdfht" style="font-family: '宋体';min-height: 850px;color: black;width: 900px" >
    <div style="margin-bottom: 100px">&nbsp;&nbsp;&nbsp;</div>
    <div style="text-align: center" class="weight font bottom">江苏惟新律师事务所</div>
    <div class="weight bottom" style="padding-left: 500px">地 址:苏州工业园区苏虹东路183号</div>
    <div class="weight bottom" style="padding-left: 500px">东沙湖基金小镇7号楼3层</div>
    <div class="weight bottom" style="padding-left: 500px">
      电 话：13912772316</div>
    <div style="text-align: center;margin-bottom: 20px" class="weight font">律 师 函</div>
    <div>
      <div style="padding-left: 60px">
        <div style="padding-left: 80px;margin-bottom: 15px" class="weight font1">
          {{this.form.name}}:
        </div>
        <div  class="font1 bottom" style="padding-left: 127px">
          江苏惟新律师事务所接受{{this.form.mcc}}的委托，
        </div>
        <div class="font1 bottom" style="padding-left: 80px">
          指派卢小平律师就贵方与委托人手机租赁事宜，致函如下：
        </div>
        <div  class="font1 weight bottom" style="padding-left: 120px">
          一、根据委托人陈述、《租赁服务协议》、《订单系统截图</div>
        <div class="font1 weight bottom" style="padding-left: 80px">
          》、《签收回执单》、《快递物流截图》、《账单详情》等材料，
        </div>
        <div class="font1 weight bottom" style="padding-left: 80px">
          我们可以明确如下基本事实。
        </div>
        <div  class="font1 bottom" style="padding-left: 120px">
          {{ this.form.createDate  }}，贵方通过右租平台向委托人租用了一部型号
        </div>
        <div class="font1 bottom" style="padding-left: 80px">
          为{{this.form.phoneModel}}的手机，
        </div>
        <div class="font1 bottom" style="padding-left: 80px">
          {{ this.form.phoneStorage }}，月租金{{ this.form.monthRent }}元，租期为{{ this.form.fixedTerm }}个月，
        </div>
        <div class="font1 bottom" style="padding-left: 80px">
          所选套餐为：{{ this.form.combo }}。
        </div>
        <div  class="font1 bottom" style="padding-left: 120px">
          委托人已按约定于{{ this.form.sendDate }}寄出手机(物流单号：
        </div>
        <div class="font1 bottom" style="padding-left: 80px">
          {{ this.form.trackingNumber }})贵方于{{this.form.signDate}}签收了该手机。后贵方仅
        </div>

        <div  class="font1 bottom" style="padding-left: 80px">
          支付第{{this.form.first}}期租金，自第{{this.form.fourth}}期交租日（{{this.form.payMentDate}}）起，未
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          再支付过任何租金。委托人多次联系贵方，要求贵方按约定支付租
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          金，但贵方拒不支付。
        </div>
        <div  class="font1 bottom" style="padding-left: 120px">
          根据《租赁服务协议》第12.3条的约定，委托人与贵方之间的租
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          赁服务关系已自动转变为买卖合同关系；根据《租赁服务协议》的
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
         第12.4条约定，贵方应在收到委托人的书面通知之日起15日之
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          内向委托人支付手机的买断款{{ this.form.paymentOut }}元（根据《租赁服务协议》的
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          第12.4条约定，买断款＝买断价－已付租金－已付押金，即买断款=
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          {{ this.form.paymentOut1 }}元-{{ this.form.paymentOut2 }}元-{{ this.form.paymentOut3 }}元
          ={{ this.form.paymentOut }}元）。
        </div>
        <div  class="font1 bottom" style="padding-left: 120px">
          贵方长时间怠于付款的行为已经让委托人产生内心焦虑，并且也
        </div>
        <div style="margin-bottom: 300px"></div>
        <div style="margin-bottom: 150px"></div>
        <div  class="font1 bottom" style="padding-left: 80px;margin-top: 350px">
          有违贵方的付款承诺。故而委托人委托本律师向贵司发送律师函。
        </div>
        <div  class="font1 bottom weight" style="padding-left: 120px">
          二、律师意见。
        </div>
        <div  class="font1 bottom" style="padding-left: 120px">
          本律师认为：贵方与委托人合作应本着诚实信用的原则。
        </div>
        <div  class="font1 bottom" style="padding-left: 120px">
          贵方迟延向委托人付款的行为，已经违反我国《中华人民共和国
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          民法典》的相关规定，依法应当承担付款责任。
        </div>
        <div  class="font1 bottom weight" style="padding-left: 120px">
          为维护委托人的合法权益，本律师严正发表声明如下：
        </div>
        <div  class="font1 bottom" style="padding-left: 120px">
          一、请贵方在收悉本律师函之日起十五日内立即向委托人支付买
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          断款人民币{{this.form.paymentOut}}元。
        </div>
        <div  class="font1 bottom" style="padding-left: 120px">
          二、如若贵方不按上述期限履行付款义务，又未主动协商还款方
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          案，本律师将立即通过法律途径依法维护委托人的合法权益，并追究
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          贵方相关法律责任。
        </div>
        <div  class="font1 bottom" style="padding-left: 120px">
          届时，委托人将不再保留友好协商的余地；贵方不但面临账户被
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          冻结、财产被查封的法律风险，而且还需承担相应的逾期利息、诉讼
        </div>
        <div  class="font1 bottom" style="padding-left: 80px">
          费、律师费等额外费用，希慎重待之！
        </div>
        <div  class="font1 bottom weight" style="padding-left: 140px">
          顺 颂
        </div>
        <div  class="font1 bottom weight" style="padding-left: 80px">
          商  祺！
        </div>
        <div  class="font1 weight" style="padding-left: 500px;margin-bottom: 50px">
          江苏惟新律师事务所
        </div>
        <div  class="font1 weight" style="padding-left: 530px;margin-bottom: 50px">
          卢小平  律师
        </div>
        <div  class="font1 weight" style="padding-left: 510px;margin-bottom: 50px">
          {{ this.form.now}}
        </div>

        <div  class="font1 bottom weight" style="padding-left: 80px">
          卢律师联系电话：13912772316
        </div>
      </div>
    </div>
    <!--    </div>-->
  </div>
  <div
      slot="footer"
      class="dialog-footer"
  >
    <el-button
        type="primary"
        @click="dialogVisible=false"
    >关闭</el-button>
    <el-button type="primary" @click="save">下载</el-button>
  </div>
</el-dialog>
</template>

<script>
import {getPdf} from "../../../htmlToPdf";
import{alterPdf}  from '@/api/order'

export default {
  props:['letterItem'],
  data(){
   return{
     dialogVisible: false,
     total: 0,
     form: {
       name: '',
       mcc:'',
       createDate:'',
       phoneModel:'',
       phoneStorage:'',
       monthRent:'',
       fixedTerm:'',
       combo:'',
       trackingNumber:'',
       paymentNumber:'',
       region: '',
       sendDate: '',
       signDate:'',
       first:'',
       fourth:'',
       payMentDate:'',
       contract:'',
       contract1:'',
       contract2:'',
       paymentOut:'',
       paymentOut1:'',
       paymentOut2:'',
       paymentOut3:'',
       platform:'',
       now:'',
     },
   }
  },
  watch:{
    dialogVisible(val){
      if (val){
        this.setpdf();
      }
    }

  },
  methods: {
    //this.letterItem
    setpdf() {
      this.form.name = this.letterItem.realname;
      this.form.mcc = this.letterItem.shopname;
      this.form.createDate = this.letterItem.createTime;
      this.form.phoneModel = this.letterItem.goods_title;
      this.form.phoneStorage = this.letterItem.setmeal_title;
      this.form.monthRent = this.letterItem.rent;
      this.form.sendDate = this.letterItem.sendtime;
      this.form.fixedTerm = this.letterItem.monCount;
      this.form.combo = this.letterItem.pact_type
      this.form.trackingNumber = this.letterItem.logistics_no;
      this.form.fourth = this.letterItem.unWhich;
      this.form.payMentDate = this.letterItem.unPayDate;
      this.form.first = this.letterItem.paycount;
      this.form.signDate = this.letterItem.confirm_time;
      this.form.paymentOut = this.letterItem.payout;
      this.form.paymentOut1 = this.letterItem.rent_total;
      this.form.paymentOut2 = this.letterItem.payRent;
      this.form.paymentOut3 = this.letterItem.foregift;
      this.form.now = this.letterItem.now;
      // this.form.name=this.letterItem
    },
    save() {

      alterPdf({order_id: this.letterItem.orderID, leaseID: this.form.fourth}).then(res => {

      })
      // this.form.fourth
      getPdf(this.form.name + '律师函', 'pdfht');
      this.dialogVisible=false;
      this.$emit('getList', true);
    },

  }
}
</script>


<style lang="scss" scoped>

.weight{
  font-weight: bold;
}
.font{
  font-size: 27px;
}
.font1{
  font-size: 22px;
}
.bottom{
  margin-bottom: 10px;
}
.height1{
  overflow: auto;
}

</style>